﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AirHockey
{
    public class GameTime
    {
        #region Members
        private long lastUpdateTime;
        private long elapsedGameTime;
        private long totalGameTime;
        #endregion

        #region Properties
        public long ElapsedGameTime
        {
            get
            {
                return elapsedGameTime;
            }
        }

        public long TotalGameTime
        {
            get
            {
                return totalGameTime;
            }
        }
        #endregion

        #region Constructor
        public GameTime()
        {
            lastUpdateTime = 0;
            elapsedGameTime = 0;
            totalGameTime = 0;
        }

        public void UpdateElapsedGameTime(long gameTime)
        {
            elapsedGameTime = gameTime - lastUpdateTime;
            totalGameTime += gameTime;
            lastUpdateTime = gameTime;
        }
        #endregion
    }
}
